#编写一个能生成8位数随机密码的程序；使用random的choice函数随机取出字符；改进程序，用户可以自己决定生成多少位密码
import random,string
#l =int(input('请输入要生成密码的位数：'))
#x = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST0123456789'
x = string.digits + string.ascii_letters
def randpass(l=8):
    i = 1
    mima = ''
    while i <= l:
        y = random.choice(x)
        mima = mima + y
        i += 1
    return mima

if __name__ == '__main__':
  # print(randpass(18))
  # print(randpass())
